#ifndef __SINGLETON_H__
#define __SINGLETON_H__

namespace sf
{
    namespace utility
    {

        template <typename T>
        class Singleton
        {
        public:
            static T *instance()
            {
                if(m_instance == nullptr)
                {
                    m_instance = new T();
                }
                return m_instance;
            }

        private:
            Singleton() {}
            Singleton(const Singleton<T> &) {}
            ~Singleton() {}
            Singleton<T> &operator=(const Singleton<T>);

        private:
            static T *m_instance;
        };

        template <typename T>
        T * Singleton<T>::m_instance = nullptr;

    }
}

#endif